package com.goods.shop.util;

import org.springframework.util.Base64Utils;

public class EnDeUtils {
    public static String AESEn(String message,String key){
        String result="";
        try{
            result=new String(Base64Utils.encode(AESUtils.encrypt(message.getBytes(), key)));
        }catch (Exception e){
            e.printStackTrace();
        }
        return result;
    }
    public static String AESDe(String message,String key){
        String result="";
        try {
            result=new String((AESUtils.decrypt(Base64Utils.decode(message.getBytes()), key)));
        } catch (Exception e) {
            e.printStackTrace();
        }
        return result;
    }
}
